import React, { Component } from 'react'
import Child from './Child'

export default class App extends Component {
  state = {
    salary: 11.46,
  }
  fn = (num) => {
    console.log(num)
  }
  render() {
    const { salary } = this.state

    return (
      <div>
        App: {salary}
        <hr />
        {/* #1 父亲通过自定义属性传递 */}
        {/* age='18' 传递的是字符串 '18' */}
        {/* age={19} 传递的才是数值型的 18 */}
        {/* bBar='true' 字符串的 'true' */}
        {/* bBar={true} 布尔的 true */}
        <Child
          salary={salary}
          age={18}
          bBar={true}
          jsx={<h3>Hello xxx</h3>}
          fn={this.fn}
        />
      </div>
    )
  }
}
